//
//  YXTopicCell.m
//  CreditCard
//
//  Created by 杨旭 on 2018/1/25.
//  Copyright © 2018年 杨旭. All rights reserved.
//

#import "YXTopicCell.h"
#import "YXPostModel.h"
#import "YXTopicModel.h"
@interface YXTopicCell ()

@property (weak, nonatomic) IBOutlet UIImageView *picImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *timeLab;
@property (weak, nonatomic) IBOutlet UIButton *replyBtn;
@property (weak, nonatomic) IBOutlet UIButton *likeBtn;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;

@end

@implementation YXTopicCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(YXTopicModel *)model {
    _model = model;
    [_likeBtn setTitle:_model.collerCount forState:(UIControlStateNormal)];
    [_replyBtn setTitle:_model.postReplyCount forState:(UIControlStateNormal)];
    
}

- (void)setPostModel:(YXPostModel *)postModel {
    _postModel = postModel;
    _titleLab.text = [NSString stringWithFormat:@"%@",_postModel.title];
    [_picImageView sd_setImageWithURL:[NSURL URLWithString:_postModel.portraitImgUrl] placeholderImage:[UIImage imageNamed:@""]];
    _nameLab.text = _postModel.nickname;
    _timeLab.text = [UILabel formateData:_postModel.createTime];
}

- (IBAction)replyBtnAction:(UIButton *)sender {
    
}
- (IBAction)likeBtnAction:(UIButton *)sender {
}



@end
